#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <float.h>

//int main() {
//    // 打印float类型的精度
//    printf("float类型可以表示的十进制有效位数为：%d\n", FLT_DIG);
//    
//    // 打印double类型的精度
//    printf("double类型可以表示的十进制有效位数为：%d\n", DBL_DIG);
//
//    return 0;
//}
#include <stdio.h>
int main(){
  //1.
  float  f = 0.123456789123456789;
  double d = 0.123456789123456789;
  printf("%.20f\n%.20f\n",f,d);

  //2.
  printf("%f\n",-8.0/0);
  printf("%f\n",sqrt(-4.0));

  //3.
  unsigned int x1 = 1 + 4294967295;
  unsigned int x2 = 1 + 4294967296 - 4294967295;
  printf("%u\n%u\n",x1,x2);

  int xi1 = 1 + 2147483647;
  int xi2 = INT_MIN - 1;
  printf("%d\n%d\n",xi1,xi2);

  float f1 = (1e18 + 123456.789e30) + (-123456.789e30);
  float f2 = 1.0 + (123456.789e30 + (-123456.789e30));
  printf("%f\n%f\n",f1,f2);

  return 0;
}
